﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VRAEWeb.Models;
using VRAEWeb.VRAEContribuyente;

namespace VRAEWeb.Controllers
{
    public class PagoVariosController : Controller
    {
        public ActionResult Index(String sCodigoContribuyente)
        {
            VRAEPago.SPagoClient oSPagoClient = new VRAEPago.SPagoClient();
            VRAEPago.Pago[] listaPagos = oSPagoClient.obtenerPagosId(Int32.Parse(sCodigoContribuyente));

            Session["PAgosVarios"] = listaPagos;

            return View(listaPagos);
        }

        [HttpPost]
        public ActionResult Index(FormCollection formCollection)
        {
            List<VRAEPago.Pago> listaPagoPendiente = new List<VRAEPago.Pago>();

            VRAEPago.Pago[] listaPagos = (VRAEPago.Pago[])Session["PAgosVarios"];

            listaPagoPendiente.Add(listaPagos[0]);

            Session["PagosSeleccionados"] = listaPagoPendiente;

            return RedirectToAction("Pagar", "Pago");
        }
    }
}
